import { get, post } from '../utils/request'

/**
 *
 * @returns
 */
export const loadProductCategoriesAPI = () => get('/api/v1/product_categories')

/**
 * 获取商品信息
 * @returns
 */
export const loadProductsAPI = (page = 1, category = '') =>
  get('/api/v1/products', {
    page,
    category,
  })

/**
 * 获取详情
 * @param {*} id
 * @returns
 */
export const loadDetailAPI = (id) => get('/api/homestays/detail/' + id)

/**
 * 收藏
 * @param {*} data
 * @returns
 */
export const collectHotelAPI = (data) => post('/api/collect/comments/', data)
/**
 * 搜索
 * @returns
 */
export const searchHotelAPI = (data) => get('/api/homestays/query', data)
